from django.db import models
from django.contrib.auth.models import AbstractUser

class UsersProfile(AbstractUser):
    image = models.ImageField(upload_to='user/',max_length=200,verbose_name='用户头像',null=True,blank=True)
    nick_name = models.CharField(max_length=20,verbose_name='用户昵称',null=True,blank=True)
    birthday = models.DateTimeField(verbose_name='用户生日',null=True,blank=True)
    gender = models.CharField(choices=(('girl','女'),('boy','男')),max_length=10,verbose_name='用户性别',default='girl')
    address = models.CharField(max_length=200,verbose_name='用户地址',null=True,blank=True)
    phone = models.CharField(max_length=200,verbose_name='用户手机',null=True,blank=True)


    # def __str__(self):
    #     return self.name

    class Meta:
        verbose_name = '用户信息'
        verbose_name_plural = verbose_name


class BuddhaWords(models.Model):
    name = models.CharField(max_length=100, verbose_name='心理症状名称', default="")
    description = models.TextField(verbose_name='心理症状描述', default="")
    analysis = models.TextField(help_text='心理症状讲解', default="")
    video = models.FileField(verbose_name="视频", null=True)
    audio = models.FileField(verbose_name="音频", null=True)
    photo = models.ImageField(null=True)

    # def __str__(self):
    #     return self.name

    class Meta:
        verbose_name = '心理症状信息'
        verbose_name_plural = verbose_name


class BuddhaNav(models.Model):
    class Meta:
        verbose_name = "导航栏"

    sequence = models.IntegerField(default=0)
    name = models.CharField(verbose_name="导航名称", max_length=10, blank=True, default="")
    histroy = models.TextField(verbose_name = "心理学发展")
    celebrity = models.TextField(verbose_name="心理学名人")
    organization = models.TextField(verbose_name="心理学组织")
    about_us = models.TextField(verbose_name="关于我们")
    #link = models.CharField(max_length=100, verbose_name ='', default="")


class LastSearch(models.Model):
    class Meta:
        verbose_name = "最近搜索"
    sequence = models.IntegerField(default=0)
    name = models.CharField(verbose_name="关键词名称", max_length=100, blank=True, default="")



class SystemConfig(models.Model):
    class Meta:
        verbose_name = "系统配置"
        pass
    logo = models.CharField(max_length=100)
    name = models.CharField(max_length=100)


class FriendLink(models.Model):
    class Meta:
        verbose_name = "友情链接"
        pass
    sequence = models.IntegerField(default=0)
    name = models.CharField(verbose_name="链接名称", max_length=100, blank=True, default="")
    link = models.CharField(max_length=100, blank=True, default="")
